package com.twu.biblioteca;

import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * User: mbokhari
 * Date: 11/07/2013
 * Time: 13:16
 * To change this template use File | Settings | File Templates.
 */
public class LibraryNumberChecker implements MenuInterface {

        private Notifier notifier = new Notifier();
        private Library library = new Library();
        private LibraryNumberGenerator libNumGen = new LibraryNumberGenerator();
        private LogIn logIn = new LogIn(library, libNumGen);

        public LibraryNumberChecker(Library library) {
            this.library = library;
//        this.libNumGen = libNumGen;
            this.logIn = logIn;
        }

        @Override
        public void runItems() throws IOException {
            for (Member member : library.returnAllMembers()) {
                if (member.checkIfLoggedIn() == true) {
                    member.printLibraryNumber();
                } else notifier.LibraryCheckerMessage();
            }
        }
    }

